package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementOspfv2AsrouteMapper;
import com.ruoyi.net.domain.ElementOspfv2Asroute;
import com.ruoyi.net.service.IElementOspfv2AsrouteService;

/**
 * 网元-OSPFV2进程配置-AS引入外部路由Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementOspfv2AsrouteServiceImpl implements IElementOspfv2AsrouteService 
{
    @Autowired
    private ElementOspfv2AsrouteMapper elementOspfv2AsrouteMapper;

    /**
     * 查询网元-OSPFV2进程配置-AS引入外部路由
     * 
     * @param id 网元-OSPFV2进程配置-AS引入外部路由主键
     * @return 网元-OSPFV2进程配置-AS引入外部路由
     */
    @Override
    public ElementOspfv2Asroute selectElementOspfv2AsrouteById(String id)
    {
        return elementOspfv2AsrouteMapper.selectElementOspfv2AsrouteById(id);
    }

    /**
     * 查询网元-OSPFV2进程配置-AS引入外部路由列表
     * 
     * @param elementOspfv2Asroute 网元-OSPFV2进程配置-AS引入外部路由
     * @return 网元-OSPFV2进程配置-AS引入外部路由
     */
    @Override
    public List<ElementOspfv2Asroute> selectElementOspfv2AsrouteList(ElementOspfv2Asroute elementOspfv2Asroute)
    {
        return elementOspfv2AsrouteMapper.selectElementOspfv2AsrouteList(elementOspfv2Asroute);
    }

    /**
     * 新增网元-OSPFV2进程配置-AS引入外部路由
     * 
     * @param elementOspfv2Asroute 网元-OSPFV2进程配置-AS引入外部路由
     * @return 结果
     */
    @Override
    public int insertElementOspfv2Asroute(ElementOspfv2Asroute elementOspfv2Asroute)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementOspfv2Asroute.getId())) {
            elementOspfv2Asroute.setId(uuid);
        }
        elementOspfv2Asroute.setCreateBy(SecurityUtils.getUsername());
        elementOspfv2Asroute.setCreateTime(DateUtils.getNowDate());
        elementOspfv2Asroute.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv2Asroute.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv2AsrouteMapper.insertElementOspfv2Asroute(elementOspfv2Asroute);
    }

    /**
     * 修改网元-OSPFV2进程配置-AS引入外部路由
     * 
     * @param elementOspfv2Asroute 网元-OSPFV2进程配置-AS引入外部路由
     * @return 结果
     */
    @Override
    public int updateElementOspfv2Asroute(ElementOspfv2Asroute elementOspfv2Asroute)
    {
        elementOspfv2Asroute.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv2Asroute.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv2AsrouteMapper.updateElementOspfv2Asroute(elementOspfv2Asroute);
    }

    /**
     * 批量删除网元-OSPFV2进程配置-AS引入外部路由
     * 
     * @param ids 需要删除的网元-OSPFV2进程配置-AS引入外部路由主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv2AsrouteByIds(String[] ids)
    {
        return elementOspfv2AsrouteMapper.deleteElementOspfv2AsrouteByIds(ids);
    }

    /**
     * 删除网元-OSPFV2进程配置-AS引入外部路由信息
     * 
     * @param id 网元-OSPFV2进程配置-AS引入外部路由主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv2AsrouteById(String id)
    {
        return elementOspfv2AsrouteMapper.deleteElementOspfv2AsrouteById(id);
    }
}
